j3deditor.bin.hierarchy
Class J3DeMaterial

java.lang.Object
  extended by j3deditor.bin.hierarchy.HierarchyNode
      extended by j3deditor.bin.hierarchy.J3DeMaterial

public class J3DeMaterial
extends HierarchyNode

Contains and manages an instance of javax.media.j3d.Material.

Author:
Risto Seene
See Also:
Material

Constructor Summary
J3DeMaterial(javax.media.j3d.Appearance appearance)
          Creates an instance of J3DeMaterial with the Material object from the given Appearance object.
 
Method Summary
 java.awt.Color getAmbientColor()
          Returns the ambient color of the Material object.
 int getColorTarget()
          Returns the current color target of the Material object.
 java.lang.String[] getColorTargetItems()
          Returns the array of color target names.
 java.awt.Color getDiffuseColor()
          Returns the diffuse color of the Material object.
 java.awt.Color getEmissiveColor()
          Returns the emissive color of the Material object.
 boolean getLightingEnable()
          Tests if light is used to calculate the appearance of the object this material describes.
 int getShininess()
          Returns the shininess of the Material object.
 java.awt.Color getSpecularColor()
          Returns the specular color of the Material object.
 void setAmbientColor(java.awt.Color color)
          Applies the given ambient color to the Material object.
 void setColorTarget(int colorTarget)
          Applies the given color target to the Material object.
 void setDiffuseColor(java.awt.Color color)
          Applies the given diffuse color to the Material object.
 void setEmissiveColor(java.awt.Color color)
          Applies the given emissive color to the Material object.
 void setLightingEnable(boolean state)
          Specifies if light is used to calculate the appearance of the object this material describes.
 void setShininess(int value)
          Applies the given shininess to the Material object.
 void setSpecularColor(java.awt.Color color)
          Applies the given specular color to the Material object.
 
Methods inherited from class j3deditor.bin.hierarchy.HierarchyNode
clone, equals, getChild, getIndex, getIndexOfChild, getNumberOfChildren, getParent, getParent, getType, hasNamedChild, removeChild, setName, setParent, toString, updateName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

J3DeMaterial

public J3DeMaterial(javax.media.j3d.Appearance appearance)
Creates an instance of J3DeMaterial with the Material object from the given Appearance object.

Parameters:
appearance - an instance of Appearance which material component is not null
Method Detail

getLightingEnable

public boolean getLightingEnable()
Tests if light is used to calculate the appearance of the object this material describes.

Returns:
Returns true if lighting is used, otherwise false
See Also:
Material.getLightingEnable()

setLightingEnable

public void setLightingEnable(boolean state)
Specifies if light is used to calculate the appearance of the object this material describes.

Parameters:
state - true if lighting is used, otherwise false
See Also:
Material.setLightingEnable(boolean state)

getColorTargetItems

public java.lang.String[] getColorTargetItems()
Returns the array of color target names.

Returns:
Returns the array of color target names

getColorTarget

public int getColorTarget()
Returns the current color target of the Material object.

Returns:
Returns the current color target
See Also:
Material.getColorTarget()

setColorTarget

public void setColorTarget(int colorTarget)
Applies the given color target to the Material object.

Parameters:
colorTarget - new color target
See Also:
Material.setColorTarget(int target)

getDiffuseColor

public java.awt.Color getDiffuseColor()
Returns the diffuse color of the Material object.

Returns:
Returns the diffuse color
See Also:
Material.getDiffuseColor(Color3f color)

setDiffuseColor

public void setDiffuseColor(java.awt.Color color)
Applies the given diffuse color to the Material object.

Parameters:
color - new color
See Also:
Material.setDiffuseColor(Color3f color)

getAmbientColor

public java.awt.Color getAmbientColor()
Returns the ambient color of the Material object.

Returns:
Returns the ambient color
See Also:
Material.getAmbientColor(Color3f color)

setAmbientColor

public void setAmbientColor(java.awt.Color color)
Applies the given ambient color to the Material object.

Parameters:
color - new color
See Also:
Material.setAmbientColor(Color3f color)

getSpecularColor

public java.awt.Color getSpecularColor()
Returns the specular color of the Material object.

Returns:
Returns the specular color
See Also:
Material.getSpecularColor(Color3f color)

setSpecularColor

public void setSpecularColor(java.awt.Color color)
Applies the given specular color to the Material object.

Parameters:
color - new color
See Also:
Material.setSpecularColor(Color3f color)

getEmissiveColor

public java.awt.Color getEmissiveColor()
Returns the emissive color of the Material object.

Returns:
Returns the emissive color
See Also:
Material.getEmissiveColor(Color3f color)

setEmissiveColor

public void setEmissiveColor(java.awt.Color color)
Applies the given emissive color to the Material object.

Parameters:
color - new color
See Also:
Material.setEmissiveColor(Color3f color)

getShininess

public int getShininess()
Returns the shininess of the Material object.

Returns:
Returns the shininess
See Also:
Material.getShininess()

setShininess

public void setShininess(int value)
Applies the given shininess to the Material object.

Parameters:
value - new value shininess
See Also:
Material.setShininess(float s)